<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>多组轮播</title>
    <style>
        *{
            margin: 0;
            padding: 0;
            list-style-type: none;
        }
        .box{
            width: 430px;
            height: 200px;
            margin:100px auto;
        }
       .nav{
        float: left;
        width: 100px;
        height: 200px;
        background-color: #000;
        color:#fff;
        text-align: center;
       }
       .nav li{
           width: 100px;
           height: 50px;
           line-height: 50px;
       }
       .nav li:nth-child(1){
           border-bottom:1px solid #fff;
       }
       .nav li:nth-child(2){
           border-bottom:1px solid #fff;
       }
       .nav li:nth-child(3){
           border-bottom:1px solid #fff;
       }
       .on{
           background-color: #f66;
       }
       .list{
           float: right;
           overflow: hidden;
           width: 330px;
           height: 200px;
       }
       .list li{
           position: relative;
           width: 330px;
           height: 200px;
           background-color: #f0f;
       }
       .l_bottm{
           position: absolute;
           left: 0;
           bottom: 0;
           width:330px;
           height: 35px;
           background:rgba(0, 0, 0, .4);
       }
       .l_bottm>span{
           float: right;
           width: 35px;
           height: 35px;
           margin-left: 3px;
           background-color: #ccc;
           text-align: center;
           line-height: 35px;
       }
       .l_main{
           width:330px;
           height:200px;
       }
       .l_main li:nth-child(1){
           background:url("images/s1.jpg");
       }
       .l_main li:nth-child(2){
           background:url("images/s2.jpg");
       }
       .l_main li:nth-child(3){
           background:url("images/s3.jpg");
       }
       .l_main li:nth-child(4){
           background:url("images/s4.jpg");
       }
    </style>
</head>
<body>
    <div class="box">
        <ul class="nav">
            <li>极速免税店</li>
            <li>美妆商城</li>
            <li>服装运动</li>
            <li>鞋包配饰</li>
        </ul>
        <ul class="list">
            <li>
                <ul class="l_main">
                    <li></li>
                    <li></li>
                    <li></li>
                    <li></li>
                </ul>
                <div class="l_bottm">
                    <span>4</span>
                    <span>3</span>
                    <span>2</span>
                    <span>1</span>
                </div>
            </li>
            <li></li>
            <li></li>
            <li></li>
        </ul>
    </div>
    <script>
        //1.当鼠标移入显示左侧每个li背景颜色 右侧banner显示
        //1.1隔行变色
        var oUl = document.getElementsByClassName("nav")[0];
        var oLi = oUl.getElementsByTagName("li");
        var oList = document.getElementsByClassName("list")[0];
        var oListLi = oList.getElementsByTagName("li");
        var oLm = document.getElementsByClassName("l_main")[0];
        var oMli = oLm.getElementsByTagName("li");
        for(var i = 0;i<oLi.length;i++){
            oLi[i].index = i;
            oListLi[i].index =i;
           
            oLi[i].onmouseenter = function(){
                this.className="on";
              
            }
            oLi[i].onmouseleave = function(){
                this.className="";
            }
        }
        //2.鼠标移入右侧数字banner切换
    </script>
</body>
</html>